public class Demo10 {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            for (int i = 0; i <10 ; i++) {
                System.out.print(i);
            }
        });
        System.out.println(t.getName()+" 状态: "+t.getState());
        t.start();
        System.out.println(t.getName()+" 状态: "+t.getState());
        while (t.isAlive()){
            //还存活着
            System.out.println("alive");
        }
        System.out.println(t.getName()+" 状态: "+t.getState());
    }
}
